package vo

type ErrorCode struct {
	Code int64
	Msg  string
}

var (
	ErrOk          = &ErrorCode{Code: 200, Msg: "success"}
	ErrFail        = &ErrorCode{Code: 500, Msg: "server error"}
	ErrCommon      = &ErrorCode{Code: 501, Msg: "biz error"}
	ErrParam       = &ErrorCode{Code: 502, Msg: "param error"}
	ErrPath        = &ErrorCode{Code: 503, Msg: "path error"}
	ErrAuth        = &ErrorCode{Code: 600, Msg: "鉴权失败，可能登录失效"}
	ErrLoginFail   = &ErrorCode{Code: 601, Msg: "登录失败，帐号或密码错误"}
	ErrCreateToken = &ErrorCode{Code: 602, Msg: "token生成失败，请联系管理员"}
)

var NoAuthPath = make(map[string]bool)

func init() {
	NoAuthPath["/auth/login"] = true
	NoAuthPath["/sse/conn"] = true
	NoAuthPath["/sse/close"] = true
}
